Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State channels demo #12 #26

Merged
merged 15 commits into from
Apr 5, 2019
Merged

State channels demo #12 #26

merged 15 commits into from
Apr 5, 2019

Conversation

alekseytsekov
Copy link
Contributor

No description provided.

Copy link
Contributor

@mradkov mradkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to use the 1.4.0 docker image for this demo to work?

@alekseytsekov
Copy link
Contributor Author

Is it necessary to use the 1.4.0 docker image for this demo to work?

yes

@mradkov
Copy link
Contributor

mradkov commented Feb 27, 2019

Okay, I'll test it out.

@mradkov
Copy link
Contributor

mradkov commented Feb 27, 2019

So I've stumbled upon the error you've mentioned at the end of the instructions - I'm unable to close the channel.

This is resulting in not returning the remaining balance from the off-chain state channel to the initiator.

Steps:

  1. Open the channel with the default settings - costs 120k aettos (100k balance + 20k fee);
  2. Buy a beer from the bar (5000 aettos);
  3. Close channel;

Expected:
~95k aettos to be returned to the initiator's on-chain balance.

Result / error-log:

==> responder sign tag: shutdown_sign_ack
(node:24804) UnhandledPromiseRejectionWarning: RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 33

@alekseytsekov
Copy link
Contributor Author

alekseytsekov commented Feb 27, 2019

So I've stumbled upon the error you've mentioned at the end of the instructions - I'm unable to close the channel.

This is resulting in not returning the remaining balance from the off-chain state channel to the initiator.

Steps:

  1. Open the channel with the default settings - costs 120k aettos (100k balance + 20k fee);
  2. Buy a beer from the bar (5000 aettos);
  3. Close channel;

Expected:
~95k aettos to be returned to the initiator's on-chain balance.

Result / error-log:

==> responder sign tag: shutdown_sign_ack
(node:24804) UnhandledPromiseRejectionWarning: RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 33

I am almost sure that this error came from different version of js sdk.

@thepiwo

This comment has been minimized.

Copy link
Contributor

@thepiwo thepiwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work!

@mradkov
Copy link
Contributor

mradkov commented Mar 11, 2019

Expected:
~95k aettos to be returned to the initiator's on-chain balance.

Is the issue with not returning the spare amount to the on-chain balance resolved yet?

@alekseytsekov
Copy link
Contributor Author

Expected:
~95k aettos to be returned to the initiator's on-chain balance.

Is the issue with not returning the spare amount to the on-chain balance resolved yet?

to open and close a channel transactions cost is 2 x 15 000 = 30 000

@thepiwo
Copy link
Contributor

thepiwo commented Mar 12, 2019

@mradkov are you okay if we merge?

@mradkov
Copy link
Contributor

mradkov commented Mar 12, 2019

@mradkov are you okay if we merge?

Yes. Though I think this will need to be handled - the issue when closing a channel.

@thepiwo
Copy link
Contributor

thepiwo commented Mar 13, 2019

@mradkov are you referencing to the issue I posted? This was problematic on my machine only

@mradkov
Copy link
Contributor

mradkov commented Mar 14, 2019

@mradkov are you referencing to the issue I posted? This was problematic on my machine only

It's not problematic on your machine only. I'm getting the same errors on my machine as well both on Chrome and Firefox when closing a channel.

Log:

==> responder sign tag: shutdown_sign_ack
(node:35187) UnhandledPromiseRejectionWarning: RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 33
    at boundsError (internal/buffer.js:53:9)
    at Buffer.readIntBE (internal/buffer.js:328:3)
    at F (/Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:8748)
    at Object.e [as deserialize] (/Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:6373)
    at deserializeTx (/Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/controllers/state-controller.js:225:27)
    at Object.responderSign [as sign] (/Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/controllers/state-controller.js:151:20)
    at /Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:178577
    at x (/Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:301627)
    at Generator._invoke (/Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:301415)
    at Generator.e.(anonymous function) [as next] (/Users/milenradkov/git/hack/aeternity/state-channels-demo-#12/examples/StateChannelsBar/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:301806)
(node:35187) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:35187) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Copy link
Member

@velzevur velzevur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be revisited as it uses a roma release. At least the fees and expectations for minimum amounts required must be bumped.
Till then - I block the merging of the PR

@thepiwo
Copy link
Contributor

thepiwo commented Mar 27, 2019

@velzevur did you re-review?

@thepiwo thepiwo merged commit 80bd326 into master Apr 5, 2019
@maptuhec maptuhec removed the review label Apr 5, 2019
@velzevur velzevur deleted the state-channels-demo-#12 branch April 5, 2019 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants